program g1;

{$APPTYPE CONSOLE}

var
  i, n: Integer;
  s: int64;
  a, b: array[1..10000] of Integer;
begin
  readln(n, s);
  for i := 1 to n do
    read(a[i]);
  for i := 1 to n do
    read(b[i]);
  for i := 1 to n do
    s := s - abs(a[i]-b[i]);
  writeln(s);
end.
